package com.cloudstudy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@ComponentScan(basePackages = {
        "com.cloudstudy"
})
public class FeignCliDemoN2Application {

    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(FeignCliDemoN2Application.class, args);
        String[] names = applicationContext.getBeanDefinitionNames();
        
//        for (String name : names) {
//            System.out.println(">>>>>> "+name);
//            if (name.equals("com.cloudstudy.service.PaymentFeignService")) {
//                PaymentFeignService paymentFeignService = SpringTool.getSpringBean(name);
//                CommonResult<Payment> commonResult = paymentFeignService.getPaymentById("dfd57039de7841eb9dfd066b4065fe01");
//                OrderFeignController.count.getAndIncrement();
//                System.out.println("count: " + OrderFeignController.count + ", commonResult: " + JsonTool.toJson(commonResult));
//            }
//        }
    }

}
